<?php
# Search inputs for each area
switch($optn) {
	# Microorganism
	case "micro": ?>
		<form class="micro" id="form-search" action="main.php" method="get"> <?php
			if(in_array($_COOKIE['acct']['type'], array('PRIME','ADMIN'))) { ?>
				<a id="removed-items" class="show-removed picto" href="main.php?micro=view&amp;c=remove&amp;q=Removed+microorganisms" data-tool="{'head':'Show removed microorganisms'}"></a> <?php
			} ?>
			<a id="view-taxon" class="picto view-taxon" tabindex="0" data-id="0" data-taxon="0" data-tool="{'head':'Browse taxonomy'}"></a> <?php
			if($_COOKIE['acct']['type']!='CLIENT') { ?>
				<a id="create" class="picto micro" tabindex="0" data-modal="#modCreate" data-tool="{'head':'Create new microorganism'}"></a> <?php
			} ?>
			<input name="micro" value="view" class="abled none" type="text"/>
			<input name="q" type="search" placeholder="Search&#8230;" class="search skip" value="<?php echo empty($_REQUEST['q']) ? '' : $_REQUEST['q'] ?>" data-guess="micro=guess"
				data-tool="{'head':'<span id=\'extd-search\'><a data-modal=\'#mod-extdsearch\'>Extended</a></span>','stay':'true','x':'r'}"
				<?php if(!empty($_REQUEST['q'])) { echo 'style="width:250px"'; } ?>/>
			<input name="id" type="hidden"/>
		</form> <?php
	break;
	
	# Image
	case "img": ?>
		<form class="img" id="form-search" action="main.php" method="get"> <?php
			if(in_array($_COOKIE['acct']['type'], array('PRIME','ADMIN'))) { ?>
				<a id="removed-items" class="show-removed picto" href="main.php?img=view&c=remove&q=Removed+images" data-tool="{'head':'Show removed images'}"></a> <?php
			}
			if($_COOKIE['acct']['type']!='CLIENT') { ?>
				<a id="test-img" class="picto img" tabindex="0" data-modal="#modTestImg" data-tool="{'head':'Test image layout'}"></a>
				<a id="create" class="picto img" tabindex="0" data-modal="#modCreate" data-tool="{'head':'Create new image'}"></a> <?php
			} ?>
			<input name="img" value="view" class="abled none" type="text"/>
			<input name="q" type="search" placeholder="Search&#8230;" class="search skip" value="<?php echo empty($_REQUEST['q']) ? '' : $_REQUEST['q'] ?>" data-guess="img=guess"
				data-tool="{'head':'<span id=\'extd-search\'><a data-modal=\'#mod-extdsearch\'>Extended</a></span>','stay':'true','x':'r'}"
				<?php if(!empty($_REQUEST['q'])) { echo 'style="width:250px"'; } ?>/>
			<input name="id" type="hidden"/>
		</form> <?php
	break;
	
	# Document
	case "doc": ?>
		<form class="doc" id="form-search" action="main.php" method="get"> <?php
			if(in_array($_COOKIE['acct']['type'], array('PRIME','ADMIN'))) { ?>
				<a id="removed-items" class="show-removed picto" href="main.php?doc=view&c=remove&q=Removed+documents" data-tool="{'head':'Show removed documents'}"></a> <?php
			}
			if($_COOKIE['acct']['type']!='CLIENT') { ?>
				<a id="create" class="picto doc" tabindex="0" data-modal="#modCreate" data-tool="{'head':'Create new document'}"></a> <?php
			} ?>
			<input name="doc" value="view" class="abled none" type="text"/>
			<input name="q" type="search" placeholder="Search&#8230;" class="search skip" value="<?php echo empty($_REQUEST['q']) ? '' : $_REQUEST['q'] ?>" data-guess="doc=guess"
				data-tool="{'head':'<span id=\'extd-search\'><a data-modal=\'#mod-extdsearch\'>Extended</a></span>','stay':'true','x':'r'}"
				<?php if(!empty($_REQUEST['q'])) { echo 'style="width:250px"'; } ?>/>
			<input name="id" type="hidden"/>
		</form> <?php
	break;
	
	# Location
	case "loc": ?>
		<form class="loc" id="form-search" action="main.php" method="get"> <?php
			if(in_array($_COOKIE['acct']['type'], array('PRIME','ADMIN'))) { ?>
				<a id="removed-items" class="show-removed picto" href="main.php?loc=view&c=remove&q=Removed+locations" data-tool="{'head':'Show removed locations'}"></a> <?php
			} ?>
			<a id="view-map" class="picto map loc" tabindex="0" data-tool="{'head':'View world map'}"></a> <?php
			if($_COOKIE['acct']['type']!='CLIENT') { ?>
				<a id="create" class="picto loc" tabindex="0" data-modal="#modCreate" data-tool="{'head':'Create new location'}"></a> <?php
			} ?>
			<input name="loc" value="view" class="abled none" type="text"/>
			<input name="q" type="search" placeholder="Search&#8230;" class="search skip" value="<?php echo empty($_REQUEST['q']) ? '' : $_REQUEST['q'] ?>" data-guess="loc=guess"
				data-tool="{'head':'<span id=\'extd-search\'><a data-modal=\'#mod-extdsearch\'>Extended</a></span>','stay':'true','x':'r'}"
				<?php if(!empty($_REQUEST['q'])) { echo 'style="width:250px"'; } ?>/>
			<input name="id" type="hidden"/>
		</form> <?php
	break;
	
	# Resource
	case "rsrc": ?>
		<form class="rsrc" id="form-search" action="main.php" method="get"> <?php
			if(in_array($_COOKIE['acct']['type'], array('PRIME','ADMIN'))) { ?>
				<a id="removed-items" class="show-removed picto" href="main.php?rsrc=view&c=remove&q=Removed+resources" data-tool="{'head':'Show removed resources'}"></a> <?php
			}
			if($_COOKIE['acct']['type']!='CLIENT') { ?>
				<a id="create" class="picto rsrc" tabindex="0" data-modal="#modCreate" data-tool="{'head':'Create new resource'}"></a> <?php
			} ?>
			<input name="rsrc" value="view" class="abled none" type="text"/>
			<input name="q" type="search" placeholder="Search&#8230;" class="search skip" value="<?php echo empty($_REQUEST['q']) ? '' : $_REQUEST['q'] ?>" data-guess="rsrc=guess"
				data-tool="{'head':'<span id=\'extd-search\'><a data-modal=\'#mod-extdsearch\'>Extended</a></span>','stay':'true','x':'r'}"
				<?php if(!empty($_REQUEST['q'])) { echo 'style="width:250px"'; } ?>/>
			<input name="id" type="hidden"/>
		</form> <?php
	break;
	
	# Project
	case "proj": ?>
		<form class="proj" id="form-search" action="main.php" method="get"> <?php
			if(in_array($_COOKIE['acct']['type'], array('PRIME','ADMIN'))) { ?>
				<a id="removed-items" class="show-removed picto" href="main.php?proj=view&c=remove&q=Removed+projects" data-tool="{'head':'Show removed projects'}"></a> <?php
			}
			if($_COOKIE['acct']['type']!='CLIENT') { ?>
				<a id="create" class="picto proj" tabindex="0" data-modal="#modCreate" data-tool="{'head':'Create new project'}"></a> <?php
			} ?>
			<input name="proj" value="view" class="abled none" type="text"/>
			<input name="q" type="search" placeholder="Search&#8230;" class="search skip" data-guess="proj=guess" value="<?php echo empty($_REQUEST['q']) ? '' : $_REQUEST['q'] ?>"
				data-tool="{'head':'<span id=\'extd-search\'><a data-modal=\'#mod-extdsearch\'>Extended</a></span>','stay':'true','x':'r'}"
				<?php if(!empty($_REQUEST['q'])) { echo 'style="width:250px"'; } ?>/>
			<input name="id" type="hidden"/>
		</form>	<?php
	break;
	
	# Editor
	case "edtr": ?>
		<form class="edtr" id="form-search" action="main.php" method="get">
			<input name="edtr" value="view" class="abled none" type="text"/>
			<input name="q" type="search" placeholder="Search&#8230;" class="search edtr skip" value="<?php echo empty($_REQUEST['q']) ? '' : $_REQUEST['q'] ?>" data-guess="acct=guess&edtr=1"
				<?php if(!empty($_REQUEST['q'])) { echo 'style="width:250px"'; } ?>/>
			<input name="id" type="hidden"/>
		</form> <?php
	break;
	
	# Account
	case "acct": ?>
		<form class="acct" id="form-search" action="main.php" method="get"> <?php
			if($_COOKIE['acct']['type']=='PRIME') { ?>
				<a id="removed-items" class="show-removed picto" href="main.php?acct=view&c=remove&q=Removed+accounts" data-tool="{'head':'Show removed accounts'}"></a>
				<a id="create" class="picto acct" tabindex="0" data-modal="#modCreate" data-tool="{'head':'Create new account'}"></a> <?php
			} ?>
			<input name="acct" value="view" class="abled none" type="text"/>
			<input name="q" type="search" placeholder="Search&#8230;" class="search acct skip" value="<?php echo empty($_REQUEST['q']) ? '' : $_REQUEST['q'] ?>" data-guess="acct=guess"
				<?php if(!empty($_REQUEST['q'])) { echo 'style="width:250px"'; } ?>/>
			<input name="id" type="hidden"/>
		</form> <?php
	break;
	
	# Application
	case "appn": ?> <?php
		if(in_array($_COOKIE['acct']['type'], array('PRIME','ADMIN'))) { ?>
			<a id="removed-items" class="show-removed picto" href="main.php?appn=view&c=remove&q=Removed+applications" data-tool="{'head':'Show removed applications'}"></a> <?php
		} ?>
		<form class="appn" id="form-search" action="main.php" method="get">
			<input name="appn" value="view" class="abled none" type="text"/>
			<input name="q" type="search" placeholder="Search&#8230;" class="search appn skip" value="<?php echo empty($_REQUEST['q']) ? '' : $_REQUEST['q'] ?>" data-guess="appn=guess"
				<?php if(!empty($_REQUEST['q'])) { echo 'style="width:250px"'; } ?>/>
			<input name="id" type="hidden"/>
		</form> <?php
	break;
}
?>